#ifndef __UDPENGINE_H__
#define __UDPENGINE_H__


#include <winsock.h>
#pragma comment(lib, "wsock32.lib")

class UDPEngine
{
public:
	UDPEngine(void);
	~UDPEngine(void);
public:
	BOOL SendMsg(char *Msg, int nMsgLength, char *host, short port);
	BOOL SetListenPort(int PortNum);
	BOOL SetListenPort();
private:
	static void *ListenThread(void *data);
private:
	SOCKET			m_listenSocket;			// the bind socket wait for the message
	sockaddr_in		m_nServerAdr;			// bind address store
	sockaddr_in		m_nClientAdr;			// address store the received message address
};

#endif	// __UDPENGINE_H__